Serial attached storage protocols, such as serial ATA (SATA) and serial Small Computer System Interface (SCSI) (SAS) are becoming more prevalent for connecting storage devices to a computer system. In computer systems implementing such serial storage devices, one storage device in the system may communicate with others. For example, a device requesting data (referred to as the initiator device) may receive data from a target device.
In the Serial ATA 2 (Extension to SATA 1.0a) standard, a Native Command Queuing (NCQ) is introduced to use First Party DMA (FPDMA) commands to issue multiple (e.g., up to 32) outstanding read or write commands to target devices. Along with the NCQ protocol, several host controller registers are defined in the standard (e.g., SActive Register, SNotification Registers, etc.). The SActive value represents a set of outstanding NCQ commands that have yet to be completed. The value is bit significant with each bit position representing the status of a pending NCQ command with corresponding TAG values. The bits of SActive register are set by the host when issuing new NCQ commands and are cleared by the target's final response via Set Device Bits FIS.
Typical SATA NCQ commands are issued to the SAS transport layer via firmware. As a result, the firmware has to track the number of NCQ commands that have been issued to the target. When the NCQ status returns back to the host via Set Device Bits FIS, the receive hardware has to return the status to the firmware to be processed. Having to use firmware to track the number of NCQ commands that have been issued to a target slows performance for the transaction.